var __extends =
    (this && this.__extends) ||
    (function () {
      var e = function (a, i) {
        return (e =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (e, a) {
              e.__proto__ = a;
            }) ||
          function (e, a) {
            for (var i in a)
              Object.prototype.hasOwnProperty.call(a, i) && (e[i] = a[i]);
          })(a, i);
      };
      return function (a, i) {
        function t() {
          this.constructor = a;
        }
        if ("function" != typeof i && null !== i)
          throw new TypeError(
            "Class extends value " + String(i) + " is not a constructor or null"
          );
        e(a, i),
          (a.prototype =
            null === i
              ? Object.create(i)
              : ((t.prototype = i.prototype), new t()));
      };
    })(),
  AXTabBarItemView = (function (e) {
    function a() {
      var a = e.call(this) || this;
      (a.dataArr = []),
        (a.resultArr = []),
        (a.HomeDiagoListener = {
          caller: a,
          code: 200,
          method: function (e) {
            a.npcArr = [];
            for (var i = 0; i < e.npclist.length; i++) {
              var t = e.npclist[i];
              1 == t.typeId && a.npcArr.push(t);
            }
          },
        }),
        WebSocketService.addListener(a.HomeDiagoListener),
        (a.image_tabbar_dep.visible = !1),
        (a.dataArr = [
          { index: "1", name: "状\n态", img: "btn_tab_state" },
          { index: "2", name: "副\n将", img: "btn_tab_subGeneral" },
          { index: "3", name: "物\n品", img: "btn_tab_product" },
          { index: "4", name: "交\n友", img: "btn_tab_ranking" },
          { index: "18", name: "签\n到", img: "" },
          { index: "19", name: "积\n分", img: "" },
          { index: "5", name: "擂\n台", img: "btn_tab_challenge" },
          { index: "6", name: "宝\n库", img: "btn_tab_gold" },
          { index: "7", name: "挂\n机", img: "btn_tab_guaji" },
          { index: "8", name: "组\n队", img: "btn_tab_zudui" },
          { index: "9", name: "邮\n包", img: "btn_tab_youbao" },
          { index: "10", name: "V\nI\nP", img: "btn_tab_vip" },
          { index: "11", name: "月\n卡", img: "btn_tab_yueka" },
          { index: "12", name: "帮\n派", img: "btn_tab_bangpai" },
          { index: "13", name: "排\n行", img: "btn_tab_paihang" },
          { index: "14", name: "任\n务", img: "btn_tab_renwu" },
          { index: "15", name: "公\n告", img: "btn_tab_gonggao" },
          { index: "16", name: "邀\n请", img: "btn_tab_yaoqing" },
          { index: "17", name: "退\n出", img: "btn_tab_quit" },
        ]),
        (a.resultArr = []);
      for (var i, t = 0; t < a.dataArr.length; t++) {
        var n = a.dataArr[t];
        (i = {
          index: n.index,
          name: n.name,
          img: n.img,
          item0: { skin: a.dealTabBarSkin(n) },
          label_tabBar_name: { text: a.dealDefaultName(n) },
        }),
          a.resultArr.push(i);
      }
      return (
        (a.list_tabBar_item.dataSource = a.resultArr),
        (a.list_tabBar_item.hScrollBarSkin = ""),
        (a.list_tabBar_item.selectEnable = !0),
        a.list_tabBar_item.on(
          Laya.Event.CLICK,
          a,
          a.onListTabBarItemDidClickFn
        ),
        a
      );
    }
    return (
      __extends(a, e),
      (a.prototype.dealTabBarSkin = function (e) {
        var a = "comp/Home/";
        return (
          e && e.img
            ? (a = a + e.img + ".png")
            : (a += "btn_set_guangchang.png"),
          a
        );
      }),
      (a.prototype.dealDefaultName = function (e) {
        var a = "";
        return e.img || (a = e.name), a;
      }),
      (a.openTabbarView = function () {
        return (
          null == this.tabbarVC && (this.tabbarVC = new a()),
          WebSocketService.send({ c: 200 }),
          this.tabbarVC
        );
      }),
      (a.prototype.onListTabBarItemDidClickFn = function (e) {
        if ("" != e.target.name) {
          var a = this.list_tabBar_item.selectedItem.index;
          if ("1" == a)
            (this.userInfo = UserInfoView.openView()),
              this.userInfo.pos(0, 35),
              Laya.stage.addChild(this.userInfo);
          else if ("2" == a)
            (this.subordinate = AXSubordinateView.openView()),
              this.subordinate.pos(0, 70),
              Laya.stage.addChild(this.subordinate);
          else if ("3" == a)
            (this.wearableV = AXWearableGoodView.openView()),
              this.wearableV.pos(0, 35),
              Laya.stage.addChild(this.wearableV);
          else if ("4" == a)
            (this.friendV = FriendMomentView.openFriendMomentView()),
              this.friendV.pos(0, 35),
              Laya.stage.addChild(this.friendV);
          else if ("5" == a)
            (this.challengeV = AXChallengeBattleView.showChallengeView()),
              this.challengeV.pos(0, 70),
              Laya.stage.addChild(this.challengeV);
          else if ("6" == a)
            (this.treasureV = AXTreasureView.openView()),
              this.treasureV.pos(0, 70),
              Laya.stage.addChild(this.treasureV);
          else if ("7" == a)
            this.npcArr && this.npcArr.length > 0
              ? AutoSettingsDialog.showAutoSettingsDialog(this.npcArr)
              : ToastView.toastView("当前地方没有野怪，请更换地图位置");
          else if ("8" == a) {
            var i = GroupTeamPageView.showGroupTeamView();
            i.pos(0, 35), Laya.stage.addChild(i);
          } else if ("9" == a) EmailMainControllerView.openEmailView();
          else if ("10" == a) {
            var t = VIPManagerView.openView();
            t.pos(0, 35), Laya.stage.addChild(t);
          } else if ("11" == a) {
            var n = MonthCardView.openMonthCardView();
            n.pos(0, 35), Laya.stage.addChild(n);
          } else if ("12" == a) {
            var r = FactionHomeView.showFactionHomeView();
            r.pos(0, 35), Laya.stage.addChild(r);
          } else if ("13" == a) {
            var o = AXRankListView.openView();
            o.pos(0, 35), Laya.stage.addChild(o);
          } else if ("14" == a) {
            var s = TaskboardView.openTaskView();
            s.pos(0, 70), Laya.stage.addChild(s);
          } else if ("15" == a) {
            var l = AXNoticeBoardView.openView();
            l.pos(0, 35), Laya.stage.addChild(l);
          } else if ("16" == a) {
            var d = InviteView.openView();
            d.pos(0, 0), Laya.stage.addChild(d);
          } else if ("17" == a)
            NormalDialog.showNormalDialog(
              "您确定要退出此账号吗？",
              this,
              this.onLoginOutFun
            );
          else if ("18" == a) DailySignView.showSignView();
          else if ("19" == a) {
            var g = ScoredPointHomeView.showScoredPointHomeView();
            g.pos(0, 35), Laya.stage.addChild(g);
          }
        }
      }),
      (a.prototype.onLoginOutFun = function () {
        this.removeSelf(),
          Laya.stage.event("GameMainView", { code: "close" }),
          Laya.stage.event("HomePageView", { code: "close" }),
          SelectRoleView.open();
      }),
      a
    );
  })(ui.AXTabBarItemUI);
